home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / EDISON.DIR / 00629_Script_Edison Patent Object Script < prev    next >
Text File  |  1997-05-26  |  8KB  |  249 lines

  1. --o Patent object
  2.  
  3. --instantiated as gPatentObj
  4.  
  5. property pZoomedIn, pDisplayingPatents
  6. property pBackGSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum, pPatentPictSpriteNum
  7. property pLeftBarSpriteNum
  8. property pPatentLocH, pPatentLocV
  9. property pTextLineCounter, pCurrentTextDB, pTextFieldCastNameList
  10.  
  11. property pFirstCastNumList, pLastCastNumList
  12. --BELL SPECIFIC PROPERTIES
  13. property pBellFirstCast, pBellLastCast, pBellBackGrndBaseCastName, pBellTextFieldCastName
  14. --WATT SPECIFIC PROPERTIES
  15. property pWattFirstCast, pWattLastCast
  16. --EDISON SPECIFIC PROPERTIES
  17. property pEdisonFirstCast, pEdisonLastCast, pPageSnd
  18.  
  19. property pEdisonTextFieldCastName, pEdisonBackGrndBaseCastName
  20.  
  21. global gInventorIndexNum, gScoreEventObj, gUtilityObj
  22. ------------------------------------------------------------------<<ò>>
  23. on mInit me
  24.   
  25.   set pTextLineCounter = 0
  26.   set pFirstCastNumList = [0,0,0]
  27.   set pLastCastNumList = [0,0,0]
  28.   set pTextFieldCastNameList = [0,0,0]
  29.   
  30.   --BELL
  31.   set pBellFirstCast = "BPATN1A.PIC"
  32.   set pBellLastCast = "BPATN12A.PIC"
  33.   set pBellBackGrndBaseCastName = "BDESK2.PIC"
  34.   set pBellTextFieldCastName = "Bell Patent Text"
  35.   
  36.   --EDISON
  37.   set pEdisonFirstCast = "EPATNT1A.PIC"
  38.   set pEdisonLastCast = "EPATNT9A.PIC"
  39.   set pEdisonBackGrndBaseCastName = "ESAFEBG.PIC"
  40.   set pEdisonTextFieldCastName = "Edison Patent Text"
  41.   
  42.   set pPatentLocH = 240
  43.   set pPatentLocV = 260
  44.   
  45.   set pBackGSpriteNum = 2
  46.   set pPatentPictSpriteNum = 9
  47.   set pDogEarSpriteNum = 10
  48.   set pDrawerSpriteNum = 6
  49.   set pLeftBarSpriteNum = 21  --RightBarSpriteNum is this + 1
  50.   set pPageSnd = 1392
  51.   
  52.   return me
  53.   
  54. end mInit
  55. ------------------------------------------------------------------<<ò>>
  56. on mActivate me
  57.   
  58.   --puppetSprite pBackGSpriteNum, true
  59.   puppetSprite pPatentPictSpriteNum, true
  60.   
  61.   set pDisplayingPatents = false
  62.   set pZoomedIn = false
  63.   set pCurrentTextDB =  "Edison Patent Text"
  64.   
  65.   set TempPropList = [:]
  66.   addProp (TempPropList, value(pDrawerSpriteNum), #HS)
  67.   addprop( TempPropList, 21,#RETURN)
  68.   addprop( TempPropList, 22,#RETURN)
  69.   
  70.   mSetCursors(gUtilityObj, TempPropList)
  71.   
  72.   if gInventorIndexNum = 1 then
  73.     --EDISON
  74.     
  75.     setAt(pFirstCastNumList, 1, (the number of cast pEdisonFirstCast))
  76.     setAt(pLastCastNumList, 1, (the number of cast pEdisonLastCast))
  77.     setAt(pTextFieldCastNameList, 1, (the number of cast pEdisonTextFieldCastName))
  78.     
  79.   else if gInventorIndexNum = 2 then
  80.     
  81.     --WATT
  82.     
  83.   else if gInventorIndexNum = 3 then
  84.     
  85.     --BELL
  86.     
  87.     setAt(pFirstCastNumList, 3, (the number of cast pBellFirstCast))
  88.     setAt(pLastCastNumList, 3, (the number of cast pBellLastCast))
  89.     setAt(pTextFieldCastNameList, 3, (the number of cast pBellTextFieldCastName))
  90.     
  91.   end if
  92.   
  93.   mSetToolBtns (gInterfaceMgrObj, #PATENTS, me)
  94.   
  95. end mActivate
  96. ------------------------------------------------------------------<<ò>>
  97. on mClose me
  98.   
  99.   --puppetSprite pBackGSpriteNum, false
  100.   puppetSprite pPatentPictSpriteNum, false
  101.   mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  102.   
  103. end mClose
  104. ------------------------------------------------------------------<<ò>>
  105.  
  106. on mPatentClickEvent me
  107.   
  108.   set SpriteClicked = the clickOn
  109.   
  110.   if SpriteClicked = pDogEarSpriteNum then
  111.     
  112.     if pDisplayingPatents and (not pZoomedIn) then 
  113.       
  114.       mDogEarClick(me)
  115.     end if
  116.   else if (SpriteClicked = pDrawerSpriteNum) and (not pDisplayingPatents) then 
  117.     mDisplayPatents(me)
  118.   else if (SpriteClicked = pLeftBarSpriteNum) or (Spriteclicked = pLeftBarSpriteNum + 1) then
  119.     if pZoomedIn then 
  120.       mSwitchZoomLevel(me)
  121.     else if not pZoomedIn then 
  122.       mInitiatePullOut (me)
  123.     end if
  124.   end if
  125.   
  126. end mPatentClickEvent
  127. ------------------------------------------------------------------<<ò>>
  128. on mDisplayPatents me
  129.   
  130.   
  131.   set pTextLineCounter = 1
  132.   set pCurrentTextDB = getAt(pTextFieldCastNameList, gInventorIndexNum)
  133.   mUpdateText(me)
  134.   
  135.   set tempPropList = [:]
  136.   addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
  137.   addProp (tempPropList, value(pDogEarSpriteNum), #finger)
  138.   
  139.   mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  140.   mSetCursors(gUtilityObj, tempPropList)
  141.   set pDisplayingPatents = true
  142.   set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
  143.   set the locH of sprite pPatentPictSpriteNum = pPatentLocH
  144.   set the locV of sprite pPatentPictSpriteNum = pPatentLocV
  145.   --set the castNum of sprite pBackGSpriteNum = (the number of cast pBellBackGrndBaseCastName) + 1
  146.   updateStage
  147.   
  148. end mDisplayPatents
  149. ------------------------------------------------------------------<<ò>>
  150. on mSwitchZoomLevel me
  151.   
  152.   if pZoomedIn then
  153.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) - 1
  154.     set the locV of sprite pPatentPictSpriteNum = pPatentLocV
  155.     set tempPropList = [:]
  156.     addProp (tempPropList, value(pPatentPictSpriteNum), #ZoomIn)
  157.     addProp (tempPropList, value(pDogEarSpriteNum), #finger)
  158.     mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  159.     mSetCursors(gUtilityObj, tempPropList)
  160.     set pZoomedIn = FALSE
  161.   else if not pZoomedIn then
  162.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 1
  163.     set tempPropList = [:]
  164.     addProp (tempPropList, value(pPatentPictSpriteNum), #Operate)
  165.     mUnsetCursorList(gUtilityObj, [pPatentPictSpriteNum, pDogEarSpriteNum, pDrawerSpriteNum])
  166.     mSetCursors(gUtilityObj, tempPropList)
  167.     set pZoomedIn = TRUE
  168.   end if
  169.   updateStage
  170.   
  171.   
  172. end mSwitchZoomLevel
  173. ------------------------------------------------------------------<<ò>>
  174. on mDogEarClick me
  175.   
  176.   sound stop 2
  177.   puppetsound 2, pPageSnd
  178.   if the castNum of sprite pPatentPictSpriteNum = getAt(pLastCastNumList, gInventorIndexNum) then
  179.     set the castNum of sprite pPatentPictSpriteNum = getAt(pFirstCastNumList, gInventorIndexNum)
  180.     set pTextLineCounter = 1
  181.   else 
  182.     set the castNum of sprite pPatentPictSpriteNum = (the castNum of sprite pPatentPictSpriteNum) + 2
  183.     set pTextLineCounter = pTextLineCounter + 6
  184.   end if
  185.   mUpdateText(me)
  186.   updateStage
  187.   
  188. end mDogEarClick
  189. ------------------------------------------------------------------<<ò>>
  190. on mInitiatePullOut me
  191.   
  192.   mClose(me)
  193.   go "Patents PO"
  194.   mPullOut(gScoreEventObj)
  195.   
  196. end mInitiatePullOut
  197. ------------------------------------------------------------------<<ò>>
  198. on mDragBlownUpPatent me
  199.   
  200.   set InitialMouseV = the mouseV
  201.   set InitialPatentLocV = the locV of sprite pPatentPictSpriteNum
  202.   repeat while the mouseDown
  203.     set mouseDelta = the mouseV - InitialMouseV
  204.     set NewPatentLocV = InitialPatentLocV + mouseDelta
  205.     if NewPatentLocV > 438 then set NewPatentLocV = 438
  206.     if NewPatentLocV < 82 then set NewPatentLocV = 82
  207.     set the locV of sprite pPatentPictSpriteNum = NewPatentLocV
  208.     updateStage
  209.   end repeat
  210.   
  211. end mDragBlownUpPatent
  212. ------------------------------------------------------------------<<ò>>
  213. on mUpdateText me
  214.   
  215.   set labelString = line pTextLineCounter to  (pTextLineCounter + 2) of field pCurrentTextDB
  216.   set BodyString = line (pTextLineCounter + 3) to  (pTextLineCounter + 5) of field pCurrentTextDB
  217.   mDisplaySecondaryText(gUtilityObj, LabelString, BodyString)
  218.   
  219.   
  220. end mUpdateText
  221. ------------------------------------------------------------------<<ò>>
  222. on mPatentDownClick me
  223.   
  224.   if pDisplayingPatents and pZoomedIn then 
  225.     mDragBlownUpPatent(me)
  226.     dontPassEvent
  227.   end if
  228.   
  229. end mPatentDownClick
  230. ------------------------------------------------------------------<<ò>>
  231. on mPatentUpClick me
  232.   
  233.   if pDisplayingPatents and (not pZoomedIn) then
  234.     mSwitchZoomLevel(me)
  235.   end if
  236.   
  237. end mPatentUpClick
  238. ------------------------------------------------------------------<<ò>>
  239.  
  240. on mZoom me, whatselection
  241.   
  242.   if (whatselection = 1) and  ( pZoomedIn) then 
  243.     mSwitchZoomLevel me
  244.   else if (whatselection = 2) and not pZoomedIn then
  245.     mSwitchZoomLevel me
  246.   end if
  247.   
  248. end mZoom
  249. ------------------------------------------------------------------<<ò>>